Hardsync
Platform: Commodore 64
Gametype: Undefined
_________________________

'Dance Dance Revolution' on C64 SIDs!

---

Named after one of the characteristic features of the SID chip, Hardsync is a C64 party game that follows in the (wait for it...) footsteps of games like Dance Dance Revolution and StepMania.

Using a custom adapter, I've connected a PlayStation 2 dance mat to one of the joystick ports of the C64. The adapter is documented below, in case you want to build one yourself.

It is also possible to play the game in vice, the C64 emulator. You have to enable True Drive Emulation, and since it's a PAL game, you need to select one of the PAL video chips. Map some keyboard keys to gameport 2 if you just want to try it out. But for the full experience, you really have to play with your feet; if you already have a dance pad connected to your computer (typically by means of a PSX-to-USB adapter), it should behave as a regular joystick, and be directly accessible from within vice.

hardsync (D64, 171 KB)
Hardsync (Sid, 4.8 KB)
Linus Akesson - Hardsync - Menu (MP3, 1.7 MB)
Linus Akesson - Hardsync - Hi-score and menu (MP3, 2.5 MB)
hardsync-tools-1.0 (Source tarball, 11 KB)

Adapter

The PlayStation 2 controllers run on 3.3 volts and use a simple SPI-based protocol (described here). The C64 gameport (described here) provides 5 volts and has five inputs which are typically shorted to ground by mechanical switches in the joystick.

The easiest way to connect a dance pad is to gut it, removing everything except the bare switches, and simply connect them to the gameport. However, if you know how to program a microcontroller, it's also quite easy to make an adapter. This has the benefit of leaving the dance pad intact, so you can still use it for other game systems.

My adapter uses an ATmega88, which is a bit overkill, but it's what I had at hand. I didn't find a PS2 connector (although this one seems nice if you happen to live in the USA), so I cut the cable.

Here is the schematic and the firmware (source). Build and connect at your own risk.

When I was trying out the adapter, I noticed that some of the bits transmitted from the mat were wrong. The down arrow, for instance, seemed to report 'triangle' events. After staring at the code for a very long time, unable to see anything wrong, I decided to rewire the hardware just to get something up and running. As I started to open the little plastic box at the edge of the mat, I realised that the warranty seal was broken. That's when I remembered that I had already rewired this mat, ages ago, because of some issue where up + down wasn't recognised as a valid joystick state. That's why, if you read the firmware source code, you'll find that the adapter interprets both 'down' and 'triangle' as 'down'.

Song management

Hardsync was designed from the start to allow the community to make and share new levels. Each song is a file, and you can move these files around freely to create your own personal mix. The first two files on the disk contain the game itself (and must be located in the first two directory entries). The rest of the disk can be filled to your liking with up to 32 songs. They will appear in the menu in reverse directory order. High scores are written back to the song files.

Once the menu system is up and running, you can change disks. After the change, you need to enter the operator menu (by holding left and right at the same time) and select "re-scan disk". The new disk doesn't have to contain the game, but it needs to have at least one song file on it.

Making new levels
The level making system is based on textfiles and command line tools. It has only been tested on Linux. First, get the tools and build them.

The song
Find (or make) a SID tune. Make sure it fulfills the following technical requirements:

It must use PAL vertical blank timing (50 Hz). CIA timers cannot be used.
No digis are allowed — there's no rastertime left for it.
The following memory ranges may be used: $80-$ff and $200-$2cff (and a reasonable amount of stack). Sidreloc is your friend.
Also consider the following design rules (which can be bent):

The song length should be between 1:30 and 2:00, so you will probably have to edit the song.
The tempo should be at least 120 beats per minute.
Try to select non-repetitive songs with catchy melodies. This encourages people to come back to your song many times, and is less boring for those who are watching.


http://www.linusakesson.net/games/hardsync/
